<!DOCTYPE html>
<html>
<link href="/static/css/framework-font.css" rel="stylesheet"/>
<script src="/static/js/jquery-2.1.1.js"></script>
<script src="/static/js/jquery.cookie.js"></script>



<!--引用layui弹框插件-->
<link href="/static/layui/css/layui.css" rel="stylesheet"/>
<script src="/static/layui/layui.js"></script>

<link href="/static/css/default/public.css" rel="stylesheet"/>
<body>
<style>
  html, body{background-color:#FFF!important;}
  .modal-body{background-color:#fff;padding:15px;width:80%}
  .page-header{margin-top:15px!important;}
  .add_button{border-top:1px solid #eee;padding-top:15px;}
  .config_img {
    height:65px;
    margin-top: 15px;
  }
  .images_del{text-align: center}
  .layui-form-pane .layui-form-label{font-size:12px!important;}
  .modal-body{display: inline-block;padding-bottom:0px;}
  .show_multiple{float: left;margin-left:15px;}
  #images_upload{display: inline-block;float: left;padding:0px 10px;}
  .layui-input-block p{line-height:36px;padding-left:15px;}

  .zxd_coordinate{border:1px solid silver;line-height:30px;height:30px;display: inline-block;padding:0px 10px;border-radius:3px;margin:5px;background-color: #0b6fff;color: #fff;position: relative}
  .zxd_contetnt{line-height:30px;padding-right:10px!important;padding-left:10px!important;}
  .zxd_list{display: inline-block;width:100%;line-height:38px;}
  .zxd_list div{background-color:#f5f5f5;margin-bottom:15px;padding:5px 10px;border-radius:4px;display: inline-block;width:100%}

  .zxd_list p{display: inline-block;width:100%}
  .zxd_list span{display:inline-block;text-align: right;font-size:12px;}
  .zxd_list span:last-child{float: right}
  .zxd_history{padding-right:10px!important;padding-left:10px!important;height:300px;display: block;overflow:auto;  }
  .zxd_coordinate font{
    position: absolute;
    top:-5px;border-radius: 20px;
    right:-8px;line-height:20px;height:20px;width: 20px;text-align: center;
    background-color: #FF0000;color: #FFFFFF;
  }
</style>

<div class="modal-body">

  <form class="layui-form layui-form-pane form-horizontal" action=""  name="saveForm">

    <div class="layui-form-item layui-col-md12">
      <label class="layui-form-label">时间</label>
      <div class="layui-input-block">
        <input class="layui-input" value="{$detail.show_time}" disabled>
      </div>
    </div>

    {if condition="$detail['visitor'] neq ''"}
    <div class="layui-form-item layui-col-md12">
      <label class="layui-form-label">走访人</label>
      <div class="layui-input-block">
        <input class="layui-input" value="{$detail.visitor}" disabled>
      </div>
    </div>
    {/if}

    <!--图文模型&单页模型-->
    <div class="layui-form-item" >
      <a class="layui-form-label" title="走访情况" href="javascript:;">*走访情况:</a>
      <div class="layui-input-block">
        <textarea class="layui-textarea" disabled>{$detail.content}</textarea>
      </div>
    </div>

    {if condition="$detail['condition_val'] neq ''"}
    <div class="layui-form-item layui-col-md12">
      <label class="layui-form-label">企业状况</label>
      <div class="layui-input-block">
        <input class="layui-input" value="{$detail.condition_val}" disabled>
      </div>
    </div>
    {/if}



    {if condition="$detail['problem'] neq ''"}
    <div class="layui-form-item layui-col-md12">
      <label class="layui-form-label">诉求类型</label>
      <div class="layui-input-block">
        <input class="layui-input" value="{$detail.problem}" disabled>
      </div>
    </div>
    {/if}

    {if condition="$detail['visitor'] neq ''"}
    <div class="layui-form-item layui-col-md12">
      <label class="layui-form-label">主要诉求内容</label>
      <div class="layui-input-block">
        <textarea class="layui-textarea" disabled>{$detail.problem_content}</textarea>
      </div>
    </div>
    {/if}

    {if condition="$detail['solution'] neq ''"}
    <div class="layui-form-item layui-col-md12">
      <label class="layui-form-label">诉求解决情况</label>
      <div class="layui-input-block">
        <input class="layui-input" value="{$detail.solution}" disabled>
      </div>
    </div>
    {/if}

    {if condition="$detail['images'] neq ''"}
    <div class="layui-form-item layui-col-md12" style="width:100%">
      <label class="layui-form-label">图组</label>
      <!--存储上传的图片信息-->
      <div class="layui-input-block">
        <div class="input-group">
          <!--<div id="images_upload" ><img src="/static/images/upload.jpeg" style="width:100px;height:100px;"></div>-->
          <div class="input-group show_multiple row">
            {volist name="$detail['images']" id="vo1"}
            <div class="newimg"><img src="{$vo1}" onclick="visitImg('{$vo1}');"  ><input type="hidden" name="images[]" value="{$vo1}"></div>
            {/volist}
          </div>
        </div>
      </div>
    </div>
    {/if}


    {if condition="$detail['phone'] neq ''"}
    <div class="layui-form-item layui-col-md12">
      <label class="layui-form-label">联系电话</label>
      <div class="layui-input-block">
        <input class="layui-input" value="{$detail.phone}" disabled>
        <input class="layui-input" value="{$detail.phone}" name="phone" type="hidden">
      </div>
    </div>
    {/if}

    <div class="layui-form-item layui-col-md12">
      <label class="layui-form-label">协调人员</label>
      <div class="input-group col-xs-9 addPersonnelView" style="float: left">
        {volist name="coordinateList" id="vo"}
        <span class="zxd_coordinate">{$vo.name}{if condition="$vo['dictionaries'] neq ''"}【{$vo.dictionaries}】{/if}<input type="hidden" name="accountId[]" value="{$vo.id}"> <font class="del" >x</font></span>
        {/volist}
      </div>
    </div>

    <div class="layui-form-item layui-col-md12">
      <label class="layui-form-label">操作</label>
      <div class="input-group col-xs-9" style="float: left">
        <div class="layui-btn layui-btn-normal addPersonnel" >添加协助人员</div>
      </div>
    </div>


    <div class="layui-form-item layui-col-md12" style="width:100%">
      <label class="layui-form-label">审核操作</label>
      <div class="layui-input-block">
        <input type="radio" name="status" value="1" title="通过" {if condition="$detail['status'] eq 1"} checked {/if} >
        <input type="radio" name="status" value="2" title="驳回" {if condition="$detail['status'] eq 2"} checked {/if}>
      </div>
    </div>
    <input type="hidden" name="id" value="{$detail.id}">
  </form>

</div>

<script>
  layui.use(['form','jquery','layer','laydate','table','upload'], function() { //独立版的layer无需执行这一句
    var $ = layui.jquery, layer = layui.layer,upload = layui.upload;
    $(".addPersonnel").click(function () {
      var showUrl =  "{:URL('project/Help/addPersonnel')}";
      showView(showUrl,"详情");
    });

    //删除协助人员
    $('.addPersonnelView').on('click','.del', function() {
      $(this).parent().remove();
    });


    function showView(showUrl,type){
      layer.open({
        type: 2,
        skin: 'layui-layer-demo', //样式类名
        area: ['450px','400px'],            //宽度450px,高自适应
        anim: 2,
        shadeClose: false, //开启遮罩关闭,
        maxmin: true,
        title: type,
        content:showUrl,
        btn:['添加','关闭'],
        yes: function (index,layero) {
          var body = layer.getChildFrame('body', index);
          var data = body.find("form[name='accountForm']").serializeArray();
          $.ajax({
            type: "post",
            url: "/project/help/doPersonnel",
            data: data,
            dataType: "json",
            success: function (res) {
              layer.alert(res.msg);
              if(res.code==0){
                $(".addPersonnelView").append(res.html);
              }
            }
          });
          // data.push({name: "plan_id", value: plan_id});
        },
      });
    }

  });

  function visitImg(imgUrl) {
    layer.photos({
      photos : {
        "title" : "",
        "id" : 123,
        "start" : 0,
        "data" : [
          {
            "alt" : "",
            "pid" : 666,
            "src" : imgUrl,
            "thumb" : ""
          } ]
      }
    });
  }

</script>

</body>
</html>